package com.itheima.day08_HomeWork;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Stream;

public class DemoArrayListNames {
    public static void main(String[] args) {
        List<String> one = new ArrayList<>();
        one.add("黄老邪");
        one.add("陈玄风");
        one.add("梅超风");
        one.add("陆乘风");
        one.add("曲灵风");
        one.add("武眠风");
        one.add("冯默风");
        one.add("罗玉风");
        //只要名字为三个字的成员,只要前三个人
        Stream<String> s1 = one.stream().filter(s -> s.length() == 3).limit(3);
        List<String> two = new ArrayList<>();
        two.add("张三丰");
        two.add("宋远桥");
        two.add("俞莲舟");
        two.add("俞岱岩");
        two.add("张松溪");
        two.add("张翠山");
        two.add("殷梨亭");
        two.add("莫声谷");
		// 只要姓张的人，不要前两个人
        Stream<String> s2 = two.stream().filter(s -> s.startsWith("张")).skip(2);
        Stream<String> s3 = Stream.concat(s1, s2);
        Object[] array = s3.toArray();
        for (Object o : array) {
            Person p = new Person((String) o);
            System.out.println(p);
        }
    }
}